﻿using Max.PH6_2009A.LowCode.DataAccess;
using Max.PH6_2009A.LowCode.IRespository;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH6_2009A.LowCode.Respository
{
    public class UnitOfWork : IUnitOfWork
    {
        IDbConnection _db;
        public UnitOfWork(DapperFactory factory)
        {
            _db = factory.GetIDbConnection();
        }

        //public IDbTransaction Begin()
        //{
        //    _db.Open();
        //    IDbTransaction _tran = _db.BeginTransaction();
        //    return _tran;
        //}

        public IDbConnection GetDbConnection()
        {
            return _db;
        }
    }
}
